home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2375 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: zib-berlin.de!inf2hro!honshu!gnikl
  2. From: gnikl@informatik.uni-rostock.de (Gunther Nikl)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: C compiler problem
  5. Date: 30 Jan 1996 19:53:42 GMT
  6. Organization: University of Rostock
  7. Message-ID: <4elt06$cr@taiwan.informatik.uni-rostock.de>
  8. References: <4ek3b2$a5k@nntp.novia.net>
  9. NNTP-Posting-Host: honshu.informatik.uni-rostock.de
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Tony Syslo (tsyslo@oasis.novia.net) wrote:
  13. > I have a friend who is converting a CNET BBS game from ARREX to C.
  14. > Here is his request:
  15.  
  16. > Can anyone tell me why this program is not compiling?
  17. > I am using SAS/C 6.50, and am getting a BPTR error on line 35 with the
  18. > "struct FileHandle *".
  19.  
  20. >   struct FileHandle *file_handle;
  21.  
  22.   should be "BPTR file_handle"
  23.  
  24. >   file_handle=(struct FileHandle *)Open(...);
  25.  
  26.   Remove the cast, Open() returns a BPTR
  27.  
  28. >   if(file_handle==NULL)
  29. >   {
  30. >     printf("Could not open the file!\n");
  31. >     Exit(0);
  32.  
  33.   Never use Exit() from the dos.library. It will _bypass_ your
  34.   compilers exit-code! Use *exit()*.
  35.  
  36.   BTW, its not a bright idea to mix AmigaDOS calls and c-library
  37.   calls. When using printf() you can also use fopen(),fread(),etc
  38.   for the file stuff.
  39.  
  40.   Gunther
  41.